package object1;
//包装类的演示
public class IntegerDemo1 {
    public static void main(String[] args) {
        /*
        Integer i1=new Integer(500);
        Integer i2=new Integer(500);
        System.out.println(i1==i2);//false
        System.out.println(i1.equals(i2));//true

        Integer i3=Integer.valueOf(15);
        Integer i4=Integer.valueOf(15);
        System.out.println(i3==i4);//true
        System.out.println(i3.equals(i4));//true
        int i=i4.intValue();
        System.out.println(i);//15

         */

        Integer i1=5;
        int j1=i1;
        System.out.println(j1);

        //1)通过包装类获取基本类型的取值范围
        int max1=Integer.MAX_VALUE;
        int min1=Integer.MIN_VALUE;
        System.out.println("int的最大值为"+max1+",最小值为:"+min1);

        long max2=Long.MAX_VALUE;
        long min2=Long.MIN_VALUE;
        System.out.println("long的最大值为"+max2+",最小值为:"+min2);

        //包装类可以将字符串转换为对应的基本类型
        String s1="12";
        int age1=Integer.parseInt(s1);
        System.out.println(age1);

        String s2="12.11";
        double price1=Double.parseDouble(s2);
        System.out.println(price1);



    }
}
